open Core.Std

let fail_with_parsing_error filename lexbuf =
  let curr = lexbuf.Lexing.lex_curr_p in
  let line = curr.Lexing.pos_lnum in
  let col = curr.Lexing.pos_cnum - curr.Lexing.pos_bol in
  failwithf "%s:%d:%d" filename line col ()

let main () =
  let lexbuf = Lexing.from_channel stdin in
  let top_ast =
    try
      Parser.top Lexer.read lexbuf
    with Parser.Error -> fail_with_parsing_error "<stdin>" lexbuf
  in
  ()

let () =
  main ()
